modify acquire_domstatic_pages to take an unsigned int size parameter
authorStefano Stabellini <sstabellini@kernel.org>
Thu, 16 Sep 2021 20:47:11 +0000 (13:47 -0700)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Fri, 17 Sep 2021 19:04:40 +0000 (12:04 -0700)
commit437e88417bdea0d5cd012fe9d69a3e0f8a0c13e8
tree9a8f4d85c1895e1bfd40da677741a95b0b2483f8
parent48a160f46251f9752bd39a854ca74d80fbbbe90c
modify acquire_domstatic_pages to take an unsigned int size parameter

acquire_domstatic_pages currently takes an unsigned long nr_mfns
parameter, but actually it cannot handle anything larger than an
unsigned int nr_mfns. That's because acquire_domstatic_pages is based on
assign_pages which also takes an unsigned int nr parameter.

So modify the nr_mfns parameter of acquire_domstatic_pages to be
unsigned int.

There is only one caller in
xen/arch/arm/domain_build.c:allocate_static_memory. Check that the value
to be passed to acquire_domstatic_pages is no larger than UINT_MAX. If
it is, print an error and goto fail.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/arch/arm/domain_build.c
xen/common/page_alloc.c
xen/include/xen/mm.h